//
//  PinRagModel.swift
//  XMYouPin
//
//  Created by 王宗成 on 2019/7/30.
//  Copyright © 2019 王宗成. All rights reserved.
//

import UIKit
import HandyJSON
class PinRagModel:NSObject, HandyJSON {
    
    var height:CGFloat = 0
    @objc dynamic var editorName:String? {
        
        didSet
        {
        
            switch self.editorName {
            case "pinwei_home_banner":
                
                let bannerRate:CGFloat =  1080.0/540.0

                let bannerHeight:CGFloat =  kScreenW/bannerRate
           
                self.height = bannerHeight + 10.0
                
            case "pinwei_home_kingkong":

                self.height = 85*kHeightRatio
                
            case "pinwei_home_big_article":
                let imgRate:CGFloat =  1080.0/270.0
                let imgHeight:CGFloat =  (kScreenW-20)/imgRate
                let itemHeight:CGFloat =  (kScreenW-10 - 3*8)/4
                self.height = imgHeight + itemHeight+40
                
            case "pinwei_home_article_cover":
                let bannerRate:CGFloat =  1080.0/540.0
                let bannerHeight:CGFloat =  (kScreenW-20)/bannerRate
        
                self.height = 120.0 + bannerHeight
           
            default:
                let rate:CGFloat =  1080.0/840.0
                let width:CGFloat = kScreenW
                
                self.height = width/rate
            }
        }
    }
    var pic_url:String?
    var mode:String?
    var href:String?
    var more:String?
    var title:String?
    var subtitle:String?
    var rags:Array<PinRagModel>?
    var goods_list:Array<ItemModel>?
    var banners:Array<ItemModel>?
    var items:Array<ItemModel>?
   
    override required init() {
        
    }
}
